<template>
  <div class="log_bg">
    <div class="top">
      <div class="logo">
        <a href="" @click.prevent="toIndex()"><img src="images/logo.png" /></a>
      </div>
    </div>
    <div class="login">
      <div class="log_img">
        <img src="images/l_img.png" width="611" height="425" />
      </div>
      <div class="log_c">
        <form>
          <table
            border="0"
            style="width: 370px; font-size: 14px; margin-top: 30px"
            cellspacing="0"
            cellpadding="0"
          >
            <tr height="50" valign="top">
              <td width="55">&nbsp;</td>
              <td>
                <span class="fl" style="font-size: 24px">登录</span>
                <span class="fr"
                  >还没有商城账号，<a href="Regist.html" style="color: #ff4e00"
                    >立即注册</a
                  ></span
                >
              </td>
            </tr>
            <tr height="70">
              <td>用户名</td>
              <td><input type="text" value="" class="l_user" /></td>
            </tr>
            <tr height="70">
              <td>密&nbsp; &nbsp; 码</td>
              <td><input type="password" value="" class="l_pwd" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td style="font-size: 12px; padding-top: 20px">
                <span style="font-family: '宋体'" class="fl">
                  <label class="r_rad"><input type="checkbox" /></label
                  ><label class="r_txt">请保存我这次的登录信息</label>
                </span>
                <span class="fr"
                  ><a href="#" style="color: #ff4e00">忘记密码</a></span
                >
              </td>
            </tr>
            <tr height="60">
              <td>&nbsp;</td>
              <td><input type="submit" value="登录" class="log_btn" /></td>
            </tr>
          </table>
        </form>
      </div>
    </div>
  </div>
</template>

<script>
import {mapMutations} from 'vuex'
export default {
  name: "LoginView",
  methods:{
    ...mapMutations(['setShowPage']),
    toIndex(){
        if(!(this.$route.path === '/')){
          this.$router.push({name:'index'})
        }
      }
  },
  beforeRouteLeave(_to,_form,next){
    this.setShowPage(0)
    next()
  }
};
</script>

<style>
</style>